﻿@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager

@{
    IdentityUser appUser = await UserManager.GetUserAsync(User);
    var fullName = "";
    if (appUser != null)
    {
        fullName = string.IsNullOrEmpty(appUser.UserName) ? "" : appUser.UserName;
    }


}

@if (SignInManager.IsSignedIn(User))
{

    <div class="user-panel">
        @*<div class="pull-left image">
            <img src="~/images/empty-profile.png" class="" alt="User Image">
        </div>*@
        <div class="pull-left info">
            <p></p>
            <a href="#">
                <i class="fa fa-circle text-success"></i>
                <span>@fullName (@(User.IsInRole("Admin") ? "管理员" : "普通用户"))</span>
            </a>
        </div>
    </div>

    <ul class="sidebar-menu" data-widget="tree">

        <li class="@Html.IsSelected(controller: "Home")">
            <a href="@Url.Action("Index", "Home", new { area = "" })">
                <i class="fa fa-dashboard"></i> <span>仪表板</span>
            </a>

        </li>

        <li class="@Html.IsSelected(controller: "Task")">
            <a href="@Url.Action("Index", "Task", new { area = "" })">
                <i class="fa fa-tasks"></i> <span>任务管理</span>
            </a>

        </li>

        <li class="@Html.IsSelected(controller: "TaskHistory")">
            <a href="@Url.Action("Index", "TaskHistory", new { area = "" })">
                <i class="fa fa-ioxhost"></i> <span>任务执行历史</span>
            </a>

        </li>

        <li class="@Html.IsSelected(controller: "User")">
            <a href="@Url.Action("Index", "User", new { area = "" })">
                <i class="fa fa-users"></i> <span>用户管理</span>
            </a>

        </li>

        <li class="@Html.IsSelected(controller: "MailConfig")">
            <a href="@Url.Action("Index", "MailConfig", new { area = "" })">
                <i class="fa fa-gears"></i> <span>系统设置</span>
            </a>

        </li>








    </ul>
}
